﻿using System;
using Styx.CommonBot;
using Styx.TreeSharp;
using Action = Styx.TreeSharp.Action;

namespace TuanHA_Hunter
{
    public partial class Classname
    {
        #region HunterBeastMasteryRotation

        private Composite HunterBeastMasteryRotation()
        {
            return new PrioritySelector(
                //But first, facing target
                new Decorator(
                    ret =>
                    THSettings.Instance.AutoFace &&
                    Attackable(Me.CurrentTarget, 10) &&
                    !Blacklist.Contains(Me.CurrentTarget, BlacklistFlags.All) &&
                    (Me.CurrentTarget.IsTargetingMeOrPet ||
                     Me.CurrentTarget.IsTargetingMyPartyMember ||
                     Me.CurrentTarget.IsTargetingMyRaidMember) &&
                    !Me.Mounted &&
                    !IsOverrideModeOn &&
                    !Me.IsFacing(Me.CurrentTarget),
                    new Action(delegate
                        {
                            Me.CurrentTarget.Face();
                            return RunStatus.Failure;
                        })
                    ),
                //Starting the movement right here
                MovementMoveToLoS(ret => Me.CurrentTarget),
                MovementMoveStop(ret => Me.CurrentTarget, THSettings.Instance.DistanceRange),
                //DPS Rotation Here
                StopAttackOOC(),
                TargetMyPetTarget(),
                UseHealthstone(),
                UseBattleStandard(),
                Readiness(),
                new Decorator(
                    ret => !_aoEModeOn,
                    new PrioritySelector(
                        //Start of Standard Opening Single Target No GCD
                        CallPet(),
                        KillCommandCamouflage(),
                        HoldCamouflage(),
                        LastStand(),
                        Cower(),
                        PetTankAdd(),
                        PetAttack(),
                        PetFollow(),
                        Aspect(),
                        MisdirectionPet(),
                        MisdirectionTank(),
                        RoarofSacrifice(),
                        BullHeaded(),
                        MasterCallMe(),
                        Fervor(),
                        //End of Standard Opening Single Target No GCD
                        BestialWrath(),
                        //Start of Standard Opening Single Target With GCD
                        KillShotCurrentTarget(),
                        GlaiveTossSnare(),
                        BlinkStrikeRange(),
                        ConcussiveShot(),
                        Stampede(),
                        RapidFire(),
                        SerpentSting(),
                        //End of Standard Opening Single Target With GCD
                        KillCommand(),
                        //CobraShotBMBuildFocus(),
                        ExplosiveTrapDPSCurrentTarget(),
                        FocusFire(),
                        SerpentStingImprovedBM(),
                        AMurderofCrows(),
                        GlaiveToss(),
                        Barrage(),
                        ArcaneShotCapFocusBM(),
                        Powershot(),
                        BlinkStrike(),
                        LynxRush(),
                        DireBeast(),
                        ArcaneShotBM(),
                        MendPet(),
                        CobraShotBM(),
                        SteadyShotNoCobra()
                        )
                    ),
                new Decorator(
                    ret => _aoEModeOn,
                    new PrioritySelector(
                        //Start of Standard Opening Multi Target No GCD
                        CallPet(),
                        LastStand(),
                        Cower(),
                        PetTankAdd(),
                        PetAttack(),
                        PetFollow(),
                        Aspect(),
                        MisdirectionPet(),
                        MisdirectionTank(),
                        Fervor(),
                        //End of Standard Opening Multi Target No GCD
                        KillShotCurrentTarget(),
                        RapidFire(),
                        Stampede(),
                        ExplosiveTrapDPSAoE(),
                        AMurderofCrows(),
                        MultiShot(),
                        FocusFire(),
                        GlaiveToss(),
                        Powershot(),
                        Barrage(),
                        BlinkStrike(),
                        LynxRush(),
                        DireBeast(),
                        MendPet(),
                        CobraShotAoEBM(),
                        SteadyShotNoCobra()
                        )
                    )
                );
        }

        #endregion
    }
}